/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UserPanel.java
 *
 * Created on 2011-8-21, 16:22:42
 */
package scau.jump.securitytrace.client;

import java.awt.event.ActionListener;

import javax.swing.JTextField;

/**
 *
 * @author Administrator
 */
public class UserPanel extends javax.swing.JPanel {

	private static final long serialVersionUID = -2055059562831527445L;
    public UserPanel() {
        initComponents();
    }
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
	
		jPanel1 = new javax.swing.JPanel();
	
		jScrollPane2 = new javax.swing.JScrollPane();
        userTable = new javax.swing.JTable();
        homePageButton = new javax.swing.JButton();
        previousPageButton = new javax.swing.JButton();
        nextPageButton = new javax.swing.JButton();
        lastPageButton = new javax.swing.JButton();
        pageInfoLabel = new javax.swing.JLabel();
		jLabel1 = new javax.swing.JLabel();
		accountTextField = new javax.swing.JTextField();
		jLabel2 = new javax.swing.JLabel();
		roleTextField = new javax.swing.JTextField();
		searchButton = new javax.swing.JButton();
        addButton = new javax.swing.JButton();
        updateButton = new javax.swing.JButton();
        deleteButton = new javax.swing.JButton();
	
        jLabel1.setText("帐号");
        jLabel2.setText("角色");
        searchButton.setText("搜索");
        addButton.setText("新增");
        updateButton.setText("修改");
        deleteButton.setText("删除");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(accountTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(roleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(searchButton)
                .addGap(18, 18, 18)
                .addComponent(addButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(updateButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deleteButton)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                .addComponent(deleteButton)
                .addComponent(updateButton)
                .addComponent(addButton)
                .addComponent(searchButton)
                .addComponent(roleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(accountTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jScrollPane2.setViewportView(userTable);

        homePageButton.setText("首  页");
        previousPageButton.setText("上一页");
        nextPageButton.setText("下一页");
        lastPageButton.setText("末  页");

        javax.swing.GroupLayout userPanelLayout = new javax.swing.GroupLayout(this);
        this.setLayout(userPanelLayout);
        userPanelLayout.setHorizontalGroup(
            userPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 613, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, userPanelLayout.createSequentialGroup()
                .addContainerGap(86, Short.MAX_VALUE)
                .addComponent(homePageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(previousPageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(nextPageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lastPageButton)
                .addGap(18, 18, 18)
                .addComponent(pageInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(64, 64, 64))
        );

        userPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {homePageButton, lastPageButton, nextPageButton, previousPageButton});

        userPanelLayout.setVerticalGroup(
            userPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(userPanelLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(userPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(homePageButton)
                    .addComponent(previousPageButton)
                    .addComponent(nextPageButton)
                    .addComponent(lastPageButton)
                    .addComponent(pageInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        userPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {homePageButton, lastPageButton, nextPageButton, pageInfoLabel, previousPageButton});

    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
	private javax.swing.JPanel jPanel1;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JScrollPane jScrollPane2;
	
	protected javax.swing.JTable userTable;
	protected javax.swing.JButton addButton;
	protected javax.swing.JButton deleteButton;
	protected javax.swing.JButton searchButton;
	protected javax.swing.JButton updateButton;	
	
	protected javax.swing.JTextField accountTextField;    
    protected javax.swing.JTextField roleTextField;   
	
    protected javax.swing.JButton homePageButton;
    protected javax.swing.JButton previousPageButton;
    protected javax.swing.JButton nextPageButton;
    protected javax.swing.JButton lastPageButton;
    protected javax.swing.JLabel pageInfoLabel;
    
    /**以下为get/set方法*/
    public JTextField getAccountTextField() {
    	return accountTextField;
    }
    public void setAccountTextField(JTextField accountTextField) {
    	this.accountTextField = accountTextField;
    }
    public JTextField getRoleTextField() {
    	return roleTextField;
    }
    public void setRoleTextField(JTextField roleTextField) {
    	this.roleTextField = roleTextField;
    }
    public void setPageInfoLabel(javax.swing.JLabel pageInfoLabel) {
		this.pageInfoLabel = pageInfoLabel;
	}
    public javax.swing.JLabel getPageInfoLabel() {
		return pageInfoLabel;
	}
	public javax.swing.JTable getUserTable() {
		return userTable;
	}
	public void setUserTable(javax.swing.JTable userTable) {
		this.userTable = userTable;
	}
	/**以下为button set**/
	public void setAddButton(ActionListener listener) {
		this.addButton.addActionListener(listener);
	}
	public void setSearchButton(ActionListener listener) {
		this.searchButton.addActionListener(listener);
	}
	public void setUpdateButton(ActionListener listener) {
		this.updateButton.addActionListener(listener);
	}
	public void setDeleteButton(ActionListener listener) {
		this.deleteButton.addActionListener(listener);
	}
	public void setHomePageButton(ActionListener listener) {
		this.homePageButton.addActionListener(listener);
	}
	public void setPreviousPageButton(ActionListener listener) {
		this.previousPageButton.addActionListener(listener);
	}
	public void setNextPageButton(ActionListener listener) {
		this.nextPageButton.addActionListener(listener);
	}
	public void setLastPageButton(ActionListener listener) {
		this.lastPageButton.addActionListener(listener);
	}
}
